﻿using System;
using System.Data.Objects;
using System.Linq;
using Repository;

namespace DataGenerator.DefaultSets
{
    /// <summary>
    /// Generator emplementation
    /// </summary>
    public class PersonGroupTypeSet : SetBase<PersonGroupType>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PersonGroupTypeSet"/> class.
        /// </summary>
        /// <param name="objectSet">The object set.</param>
        public PersonGroupTypeSet(ObjectSet<PersonGroupType> objectSet)
            : base(objectSet)
        {
        }

        public PersonGroupType University
        {
            get { return Get(() => University); }
            set { Set(() => University, value); }
        }

        public PersonGroupType Faculty
        {
            get { return Get(() => Faculty); }
            set { Set(() => Faculty, value); }
        }

        public PersonGroupType Speciality
        {
            get { return Get(() => Speciality); }
            set { Set(() => Speciality, value); }
        }

        public PersonGroupType Stream
        {
            get { return Get(() => Stream); }
            set { Set(() => Stream, value); }
        }

        public PersonGroupType StydyGroup
        {
            get { return Get(() => StydyGroup); }
            set { Set(() => StydyGroup, value); }
        }

        public PersonGroupType StydySubgroup
        {
            get { return Get(() => StydySubgroup); }
            set { Set(() => StydySubgroup, value); }
        }

        public PersonGroupType Department
        {
            get { return Get(() => Department); }
            set { Set(() => Department, value); }
        }

        public PersonGroupType PersonsCollaboration
        {
            get { return Get(() => PersonsCollaboration); }
            set { Set(() => PersonsCollaboration, value); }
        }

        public PersonGroupType SinglePerson
        {
            get { return Get(() => SinglePerson); }
            set { Set(() => SinglePerson, value); }
        }

        /// <summary>
        /// Searches the default value.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>Default entity.</returns>
        protected override PersonGroupType SearchDefaultValue(string name)
        {
            return ObjectSet.FirstOrDefault(e => e.Name == name);
        }
    }
}